
import {POST_TYPE} from './type'
import { dispatch } from 'rxjs/internal/observable/range';

export function fetchPost(){

    return  function(){
        fetch("https://jsonplaceholder.typicode.com/posts")
        .then(res=>res.json())
        .then(res=>dispatch({
            type:POST_TYPE,
            payload:res
        }));
    } 
}